<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderOriginalsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_originals', function (Blueprint $table) {
            $table->increments('id');
            $table->string('code',20);
            $table->string('order_code',20);
            $table->string('cinema_code',20);
            $table->integer('cinema_status');
            $table->timestamp('business_date')->nullable();
            $table->string('screen_code',20);
            $table->string('film_code',20);
            $table->string('session_code',20);
            $table->string('showtime_schedule_code',20);
            $table->timestamp('session_datetime')->nullable();
            $table->integer('operation');
            $table->string('film_ticket_code',20);
            $table->string('seat_code',20);
            $table->integer('price');
            $table->integer('service')->default(0);
            $table->integer('online_sale')->default(1);
            $table->timestamp('date_time')->nullable();
            $table->integer('flag')->default(1);//1:未上报、2：已上报
            $table->integer('count')->default(1);
            $table->integer('channel_id')->default(0);
            $table->integer('is_counted')->default(0); //是否已经统计 0：未统计，1：已统计
            $table->string('remark',200)->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_originals');
    }
}
